<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>{$CONF['mallTitle']}后台管理中心</title>
    <!--<link href="__PUBLIC__/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet">-->
    <link href="__ROOT__/Apps/Admin/View/css/AdminLTE.css" rel="stylesheet" type="text/css" />
    <link href="__PUBLIC__/font-awesome-4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="__PUBLIC__/css/pingendo.css" rel="stylesheet" type="text/css">
    <!--[if lt IE 9]>
    <script src="__PUBLIC__/js/html5shiv.min.js"></script>
    <script src="__PUBLIC__/js/respond.min.js"></script>
    <![endif]-->
    <script src="__PUBLIC__/js/jquery.min.js"></script>
    <script src="__PUBLIC__/plugins/bootstrap/js/bootstrap.min.js"></script>
    <script src="__PUBLIC__/js/common.js"></script>
    <script src="__PUBLIC__/plugins/plugins/plugins.js"></script>
    <style>
        .panel{
            border-radius: 0px;

        }

        .container{ width:100%;padding-left:25px;}


        .panel-heading{
            border-radius: 0px;
        }
    </style>
</head>
<body>

    <div class="container">
        <div class="row">
            <div class="col-md-12" id="package-container">
                <form method='post' action='{:U("Admin/Package/index")}'>

                    <div class='wst-tbar'>
                        套餐名称：<input type='text' id='tName' name='tName' />
                        所属商家：<input type='text' id='shopName' name='shopName' />


                        商品：<input type='text' id='goodsName' name='goodsName' />

                        <button type="submit" class="btn btn-primary btn-sm"  >查询<i class="fa fa-fw fa-search"></i></button>
                    </div>
                </form>
                <volist name="packageList" id="package">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <span><strong>套餐名:{$package["tName"]}</strong></span>
                            <div class="pull-right" id="{$package['tId']}">
                                <php>if(in_array('tccz_02',$WST_STAFF['grant'])){</php>
                                <a href="{:U('Admin/Package/addPackage',array('id'=>$package['tId']))}" class="btn btn-default btn-xs package-edit" >编辑<i class="fa fa-fw fa-edit"></i></a>
                                <php>}</php>
                                <php>if(in_array('tccz_03',$WST_STAFF['grant'])){</php>
                                <a class="btn btn-default btn-xs package-remove" >删除<i class="fa fa-fw fa-remove"></i></a>
                                <php>}</php>
                            </div>

                        </div>
                        <div class="panel-body">
                            <ul class="media-list">
                                <volist name = "package['goods']" id="goods">
                                    <li class="media border-botto tc-goods-li">
                                        <a class="pull-left" href="#"><img class="media-object"
                                                                           src="__ROOT__/{$goods['goodsThums']}"
                                                                           height="64" width="64"></a>

                                        <div class="media-body">
                                            <div  style="overflow: auto;"><div class="pull-left"><strong>商品：{$goods['goodsName']}</strong></div><div class="pull-right">商家：{$goods['shopName']}</div></div>
                                            <div>商品简介：{$goods['goodsSpec']}</div>
                                            <div>
                                                <span>商品价格：{$goods['periodId']?$goods['pPrice']:$goods['shopPrice']}</span>
                                                <span style="margin-left:20px;">套餐价格：{$goods['tPrice']}</span>
                                            </div>

                                        </div>
                                    </li>
                                </volist>




                            </ul>

                        </div>

                    </div>
                </volist>
                <div class="text-center">{$page}</div>

            </div>
        </div>
    </div>


<script>
    $("#package-container").on("click"," .package-remove",function(){
        var me = $(this);
        Plugins.confirm({title:'信息提示',content:'您确定要删除该套餐吗?',okText:'确定',cancelText:'取消',okFun:function(){
            Plugins.closeWindow();
            Plugins.waitTips({title:'信息提示',content:'正在操作，请稍后...'});
            $.post("{:U('Admin/Package/delPackage')}",{id:me.parent().attr("id")},function(data,textStatus){
                var json = WST.toJson(data);
                if(json.status=='1'){
                    Plugins.setWaitTipsMsg({content:'操作成功',timeout:1000,callback:function(){
                        location.reload();
                    }});
                }else{
                    Plugins.closeWindow();
                    parent.showMsg({msg:'操作失败!',status:'danger'});
                }
            });
        }});
    })
</script>
</body>
</html>